﻿using SimpleFactory.AbstractProduct;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SimpleFactory
{
    /// <summary>
    /// 业务封装
    /// </summary>
    public class Operation
    {
        /// <summary>
        /// 进行运算
        /// </summary>
        /// <param name="numberA">第一个数</param>
        /// <param name="numberB">第二个数</param>
        /// <param name="symbol">运算符</param>
        /// <returns></returns>
        public static double GetResult(double numberA,double numberB,string symbol) 
        {
            Operator oper = Factory.CreateOperator(symbol);
            
            oper.NumberA=numberA;
            oper.NumberB=numberB;

            return oper.GetResult();
        }
    }
}
